package 统计一个圆中点的数目;

/**
 * @Program:IntelliJ IDEA
 * @description:
 * @author:香蕉你个啵娜娜 l.h-p@qq.com
 * @create:2023-01-24 21:49
 **/

public class Solution {
    public int[] countPoints(int[][] points, int[][] queries){
        int n = queries.length;
        int[] ret = new int[n];
        for (int i = 0; i < n; i++){
            for (int[] point : points) {
                if (inCircle(point, queries[i][0], queries[i][1], queries[i][2])){
                    ret[i]++;
                }
            }
        }
        return ret;
    }


    public boolean inCircle(int[] point, int x, int y, int r){
        return (point[0] - x) * (point[0] - x) + (point[1]- y) * (point[1] - y) <= r*r;
    }
}
